<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS优先级</title>
    <style>
        /* 选择顺序：继承或者* <元素选择器 <类选择器，伪类选择器 <ID选择器 <行内样式“style=""”< !important */
        .nav {
            color: pink;
        }

        div {
            color: rgb(31, 215, 218) !important;
        }

        #demo {
            color: red;
        }
    </style>
</head>

<body>
    <div class="nav" id="demo" style="color: goldenrod;">你笑起来真好看</div>
</body>

</html>